<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Delete the exchange from the broker.</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="amqpexchange.declare.html">AMQPExchange::declare</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="amqpexchange.getargument.html">AMQPExchange::getArgument</a></div>
 <div class="up"><a href="class.amqpexchange.html">AMQPExchange</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="amqpexchange.delete" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">AMQPExchange::delete</h1>
  <p class="verinfo">(PECL amqp &gt;= Unknown)</p><p class="refpurpose"><span class="refname">AMQPExchange::delete</span> &mdash; <span class="dc-title">Delete the exchange from the broker.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-amqpexchange.delete-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>AMQPExchange::delete</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = <strong><code>AMQP_NOPARAM</code></strong></span></span>
  ] )</div>

  <p class="para rdfs-comment">
    Delete and exchange from the broker.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-amqpexchange.delete-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">flags</code></em></dt>

     <dd>

      <p class="para">
       Optionally <strong><code>AMQP_IFUNUSED</code></strong> can be specified to indicate the exchange
       should not be deleted until no clients are connected to it.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-amqpexchange.delete-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws <strong class="classname">AMQPExchangeException</strong> on failure.
  </p>
  <p class="para">
   Throws <strong class="classname">AMQPChannelException</strong> if the channel is not open.
  </p>
  <p class="para">
   Throws <strong class="classname">AMQPConnectionException</strong> if the connection to the broker was lost.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-amqpexchange.delete-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-amqpexchange.delete-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4108">
    <p><strong>Example #1 <span class="methodname"><strong>AMQPExchange::delete()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;connection&nbsp;*/<br /></span><span style="color: #0000BB">$cnn&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">AMQPConnection</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$cnn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;exchange&nbsp;*/<br /></span><span style="color: #0000BB">$ex&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">AMQPExchange</span><span style="color: #007700">(</span><span style="color: #0000BB">$cnn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$ex</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">declare</span><span style="color: #007700">(</span><span style="color: #DD0000">'new_topic_exchange'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">AMQP_EX_TYPE_DIRECT</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">AMQP_DURABLE&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">AMQP_AUTODELETE</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Delete&nbsp;the&nbsp;previous&nbsp;exchange&nbsp;*/<br /></span><span style="color: #0000BB">$ex2&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">AMQPExchange</span><span style="color: #007700">(</span><span style="color: #0000BB">$cnn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$ex2</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">delete</span><span style="color: #007700">(</span><span style="color: #DD0000">'new_topic_exchange'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="amqpexchange.declare.html">AMQPExchange::declare</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="amqpexchange.getargument.html">AMQPExchange::getArgument</a></div>
 <div class="up"><a href="class.amqpexchange.html">AMQPExchange</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
